<template>
    <div>
        <van-grid :column-num="3" :border="false" :center="true">
            <van-grid-item v-for="value in homeArr" :key="value.title">
                <img v-lazy="value.src" @click="toGoodsDetail"/>
                <p class="goodsName">{{value.goodsName}}</p>
            </van-grid-item>
        </van-grid>
    </div>
</template>

<script>
export default {
    props:["homeArr"],
    methods: {
      //点击商品去到商品详情页面
      toGoodsDetail(){
        this.$router.push({path:'/goodDetail'}).catch(err => {})
      }
    },
};
</script>

<style lang="less" scoped>
/deep/.van-grid-item__content{
    padding-top: 20px;
    padding-bottom: 20px;
}
</style>
